package com.joker.demo.core.domain.enums;


/**
 * @author : feixiang.li
 * @since : 2025-07-23 21:35
 */
public enum JobMisfireStrategyEnum {

    /**
     * 不做任何事情
     */
    DO_NOTHING(1, "不做任何事情"),
    /**
     * 立即触发一次
     */
    FIRE_ONCE_NOW(2, "立即触发一次"),

    ;

    private final Integer code;
    private final String desc;


    JobMisfireStrategyEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static JobMisfireStrategyEnum getByCode(Integer code) {
        for (JobMisfireStrategyEnum value : JobMisfireStrategyEnum.values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
